<link rel="stylesheet"
	href="__ROOT__/Public/Plugins/uploadify/uploadify.css" />
<script type="text/javascript"
	src="__ROOT__/Public/Plugins/uploadify/jquery.uploadify-3.1.min.js"></script>
<script type="text/javascript"
	src="__ROOT__/Public/Plugins/uploadify/jquery.jUpload.js"></script>
<script type="text/javascript">
    $(function() {
		$('#show_msg').hide();
        $("#upload1").jUpload({
            trigger_id: "t_upload1",
            uploader: "{:U('uploadify/head_img')}",
            queueID: "upload1-queue",
            formData: {
                "<?php echo session_name(); ?>": "<?php echo session_id(); ?>",
                "savePath": "/Upload/images/names/",
                "saveRule": "time",
                "divId": "img1",
                "thumb": 1
            },
            success: function(data, info) {
                var img = $("#img1 img");
                if (img.length == 0) {
                    img = $("<img src=\"" + _root_ + data[0]["path"] + "\" alt=\"" + info + "\" style=\"max-height:200px;max-width:300px;\"/>")
                    $("#img1").append(img);
                } else {
                    img.attr("src", _root_ + data[0]["path"]);
                }
                $("input[name=imgid]").val(data[0]['id']);
                $("input[name=imgurl]").val(data[0]['path']);
                $("input[name=imgwidth]").val(data[0]['width']);
                $("input[name=imgheight]").val(data[0]['height']);
            }
        });
    })
function formcheck()
{

	return true;
}
</script>
<div id="nav" class="mainnav_title">
	<ul>
		<a href="{:U('lists')}">线路地区</a> |
		<a class="on" href="{:U('add')}">添加</a>
	</ul>
</div>
<form name="myform" method="post" id="myform"
	action="{:U('linearea/add')}" onSubmit="return formcheck();">
	<table border="0" cellspacing="0" cellpadding="0" class="table_form"
		width="100%" style="margin: 10px 0px 0px 10ox;">
		<tr>
			<th width="10%"><span class="red">*</span>地区名称:</th>
			<td width="90%"><input type="text" name="name" id="name"
				class="input-text" /></td>
		</tr>
		<tr>
			<th width="10%"><span class="red">*</span>地区编码:</th>
			<td width="90%"><input type="text" name="code" id="code"
				class="input-text" /></td>
		</tr>
		<tr>
			<th width="10%"><span class="red">*</span>别名:</th>
			<td width="90%"><input type="text" name="asname" id="asname"
				class="input-text" /></td>
		</tr>
		<tr>
			<th><span class="red">*</span>图片</th>
			<td>
				<div id="img1"></div>
				<div id="upload1-queue"></div> <input class="isFile" type="hidden"
				id="photo_1" name="pic_front" /> <input data-msg-isFile="请上传图片"
				class="isFile" id="upload1" name="file_upload1" type="file" /> <a
				class="upload_bt" href="javascript:void(0);" id="t_upload1"
				onclick="$('#show_msg').hide();">点击上传</a><span
				class="Validform_checktip f_left Validform_wrong" id="show_msg">请先上传图片再提交</span>
			</td>
		</tr>
		<input type="hidden" class="text" name="imgurl" id="imgurl" value="" />
		<input type="hidden" class="text" name="imgid" id="imgid" value="" />
		<input type="hidden" class="text" name="imgwidth" id="imgwidth" value="" />
		<input type="hidden" class="text" name="imgheight" id="imgheight" value="" />
		<tr>
			<td height="100">&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
	</table>

	<div id="btnbox" class="btn">
		<input type="submit" name="submit" value=" 保 存 " class="button">
		<input type="reset" name="reset" value=" 重 置 " class="button">
	</div>
</form>